package edu.princeton.cogsci.wn.search;

import edu.princeton.cogsci.wn.*;

/** This class is the abstract base class that defines the functionality of a
 *  WordNet search.
 *
 *  @see SearchResults
 *  @see SearchParameters
 */
public abstract class SearchMacro
{
  /** A reference to the active WordNet implementation. <B>Implementation
   *  Note:</B> this reference is set by invoking
   *  <CODE>WordNetImpl.getCurrentWNI( )</CODE>, which returns the
   *  <CODE>WordNetImpl</CODE> object that most recently registered itself
   *  by calling <CODE>WordNetImpl.setCurrentWNI( )</CODE>.
   */
  protected WordNetImpl wni = WordNetImpl.getCurrentWNI( );

  /** Returns the name of this search, for display in a user agent. */
  public abstract String getName( );

  /** Returns the name of this search, for display in a user agent. */
  public String toString( ) { return getName( ); }

  /** Performs the search specified by <CODE>params</CODE> and returns the
   *  results.
   */
  public abstract SearchResults doSearch( SearchParameters params );

  /** Expands a search-results node by performing another level of search. */
  public abstract void expandSearch( SearchResults.Node parent );
}
  
